// pages/person/person.js
import {
  getUaUserPage
} from "../../api/user.js";
Page({
  /**
   * 页面的初始数据
   */
  data: {
    uaUserId: "",
    iconList: [{
      icon: 'formfill',
      color: 'purple',
      badge: 11,
      name: '待出行',
      url: '/pages/person/order/order'
    },{
      icon: 'cartfill',
      color: 'red',
      badge: 0,
      name: '购物车',
      bindtap: "bindZan",
      url: '/pages/person/cart/cart'
    }, {
      icon: 'shopfill',
      color: 'green',
      badge: 0,
      name: '返修/售后',
      bindtap: "bindPoint"
    }],
    iconOtherList: [{
      icon: 'location',
      color: 'blue',
      badge: 0,
      name: '游记收藏',
      url: '/pages/person/manage/manage'
    }, {
      icon: 'vipcard',
      color: 'blue',
      badge: 0,
      name: '会员卡',
      url: "vip"
    }, {
      icon: 'ticket',
      color: 'blue',
      badge: 0,
      name: '优惠券',
      url: "coupon"
    }, {
      icon: 'people',
      color: 'blue',
      badge: 0,
      name: '退出',
      url: '/pages/login/login'
    }],
  },
  carinfo() {
    wx.navigateTo({
      url: '../person/order/order',
    })
  },
  replay() {
    wx.navigateTo({
      url: '../../pages/login/login',
    })
  },
  jumpdingdan(e) {
    console.log(e)
    let id = e.currentTarget.dataset.id;
    id = JSON.stringify(id)
    wx.navigateTo({
      url: '../person/order/order?id=' + id
    })
  },
  jumpPage(e) {
    console.log(e)
    let url = e.currentTarget.dataset.url;
    // let id = e.currentTarget.dataset.id;
    // id = JSON.stringify(id)
    wx.navigateTo({
      url: url+1,
    })
  },
  jumpPage1(e) {
    console.log(e)
    let url = e.currentTarget.dataset.url;
    wx.navigateTo({
      url: url,
    })
  },
  focus() {
    wx.navigateTo({
      url: './foucs/focus',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getUaUserPage();
  },
  getUaUserPage() {
    let data = {
      "pageNum": "1",
      "pageSize": "10",
      "id": null,
      "openid": null,
      "nickname": null,
      "sex": null,
      "province": null,
      "city": null,
      "conuntry": null,
      "headimgurl": null,
      "language": null,
      "purePhoneNumber": null,
      "status": null,
      "delFlag": null,
      "createBy": null,
      "createTime": null,
      "updateBy": null,
      "updateTime": null,
      "remark": null
    }
    getUaUserPage(data).then(res => {
      let datalist = res.data.data.records[0].id
      console.log(datalist)
      this.setData({
        uaUserId: datalist
      })
    })
  },

})